package chap8.innerclass;

import chap8.innerclass.MyOuterClass.MyInnerClass;
import chap8.innerclass.MyOuterClass.staticMyInnerClass;


public class InnerClassTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		MyInnerClass innerClass = new MyOuterClass().new MyInnerClass();
		innerClass.innerMethodOne();
		innerClass.innerMethodTwo();
		innerClass.callOuterMethods();
		
		new MyOuterClass().callInnerMethods();
		new MyOuterClass().outerMethodOne();
		new MyOuterClass().outerMethodTwo();

	}
	/**
	 * Calling static inner class from non static other class. 
	 * same rule applies for calling from method	 * 
	 */	
	
	staticMyInnerClass myInnerClass = new MyOuterClass.staticMyInnerClass();

	/**
	 * Calling Non - Static inner class from non static other class.
	 * same rule applies for calling from method 
	 */
	
	MyInnerClass myInnerClass1 = new MyOuterClass().new MyInnerClass();
}
